import java.util.Scanner;


/**
 *Lt
 */


public class Test01 {


    public static void main(String[] args) {

   


        Scanner sc=new Scanner(System.in);

        Bank bank=new Bank();

        while (true) {
            System.out.println("****************");
            System.out.println("1.用户开户 2.用户登录 9.统计 输入其他退出");
            int ss=sc.nextInt();

            if (ss==1) {
                System.out.println("请输入账户id");
                int id=sc.nextInt();
                System.out.println("请输入账户密码");
                String mm=sc.next();
                System.out.println("请输入名字");
                String mz=sc.next();
                System.out.println("请输入身份证号");
                String sfzh=sc.next();
                System.out.println("请输入邮箱");
                String yx=sc.next();
                System.out.println("请输入存款");
                double ck=sc.nextDouble();
                System.out.println("请选择 1.储蓄卡 2.信用卡 输入其他退出");
                int card=sc.nextInt();
                if (card==1) {
                    bank.kh(card, id, mm, mz, sfzh, yx, ck,0);
                }else if (card==2) {
                    System.out.println("请输入信用金额（开户可设置最大为1000）");
                    double xyed=sc.nextDouble();
                    if (xyed<=1000) {
                        bank.kh(card, id, mm, mz, sfzh, yx, ck,xyed);
                    }
                }
            }else if (ss==2) {
                System.out.println("请输入账户id");
                int id=sc.nextInt();
                System.out.println("请输入账户密码");
                String mm=sc.next();

                if (bank.dl(id, mm)) {
                    while (true) {
                        System.out.println("*****可以进行以下操作*****");
                        System.out.println("3.存款 4.取款 5.设置透支额度 输入其他退出");
                        int cd=sc.nextInt();
                        if (cd==3) {
                            System.out.println("请输入存款金额");
                            double ck=sc.nextDouble();
                            bank.ck(id,ck);
                        }else if (cd==4) {
                            System.out.println("当前账户为"+id);
                            System.out.println("请输入取款金额");
                            double qk=sc.nextDouble();
                            bank.qk(id,qk);
                        }else if (cd==5) {
                            System.out.println("请输新的信用金额");
                            double xyed=sc.nextDouble();
                            bank.xyk(id,xyed);
                        }
                        else {
                            break;
                        }
                    }

                }

            }else if (ss==9) {
                bank.tongji();
            }else {
                System.out.println("已退出");
                break;
            }




        }



    }
}
